import http from "./request";
// 登录请求
export const loginHttp = (params: ILoginparams): RES<IloginadminModel> =>
  http.post("/admin/login", params);
// 用户信息请求
export const infoHttp = ():RES<RootObject> => http.get("/admin/info");
// 根据用户名或姓名分页获取用户列表
export const listHttp = (params:IlistParams):RES<IadminList> => http.get("/admin/list",{params});
// 根据角色名称分页获取角色列表
export const roleHttp = (params:IroleParams):RES<roleModel> => http.get("/role/list",{params});
// 用户注册
export const registerHttp = (params: IUserlist): RES<IUserlist> =>http.post("/admin/register", params);
// 获取指定用户信息
export const getuserinfoidHttp = (id:number):RES<IUserlist> => http.get(`/admin/${id}`);
// 修改指定用户信息
export const updateinfoHttp = (params: IUserlist): RES<number> =>http.post(`/admin/update/${params.id}`, params);
// 修改角色状态
export const UpdateStatusAPI = (id:number,status:number):RES<number>=>http.post(`/admin/updateStatus/${id}?status=${status}`)
// 获取所有角色 
export const listAllHttp = ():any => http.get(`/role/listAll`);
// 获取指定用户的角色 /admin/role/{adminId}
export const roleIdHttp = (id:number):any => http.get(`/admin/role/${id}`);
// 获取用户分配角色
export const roleupdateinfoHttp = (params: IUserlist): RES<number> =>http.post(`/admin/role/update`, params);